package Thread.two;

import javax.swing.JFrame;
import javax.swing.JLabel;

public class ThreadTwo extends Thread{
	JLabel jl;
	public ThreadTwo() {
		JFrame jf=new JFrame("Class Demo");
		jl=new JLabel();
		jf.add(jl);
		jf.setVisible(true);
		jf.setLocation(200, 200);
		jf.setSize(200,200);
		
		
	}

	public void run() {
		while(true) {
			if(jl.getText().equals("")) {
				jl.setText("Welcome to java Family");
			}else {
				jl.setText("");
			}
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

	}
	

}
